home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 34
/
Amiga Format CD34 (1998-11-20)(Future Publishing)(GB)[!][Christmas issue].iso
/
-seriously_amiga-
/
emulation
/
afid
/
afid.doc
< prev
next >
Wrap
Text File
|
1998-10-20
|
8KB
|
199 lines
name:
afid - apple ][ file developer
usage:
afid [file_image]
synopsis:
This file describes version 1.1 of afid.
description:
afid is a utility which allows you to manipulate an Apple ][ DOS 3.3 disk
image. It currently doesn't handle ProDOS disk images and only reads and
writes 35 track, 16 sector diskette images.
new for version 1.1:
1) Added a help message listing the commands.
2) Added the ability to load different file images from within afid,
so you no longer need to exit and enter with a new image.
3) Prompts the user when attempting to exit without saving a changed
disk image.
4) Added new commands like load, list, mode, type, lock/unlock, rename,
delete/undelete.
instructions:
afid provides a simple command line interface. You start it up by giving
it the name of a disk image:
afid file.dsk
It then reads the disk image into memory, does a few sanity checks and
gives you the "] " prompt. If you fail to include the name of the disk
image, afid will still come up, but you can't do anything until you load
a disk image.
From within afid you can use the following commands:
load image - this loads the specified disk image from your host file
system into afid memory. You need to have a disk image
in memory in order to do anything in afid. This command
enables you to successively load different disk images
into afid without the need of exiting and loading a new
image from the command line. If you already have a
changed, unsaved disk image in memory, afid will prompt
you with a warning before complying with the request.
You can specify the full path name to the disk image if
it is not in the current directory.
catalog - show a directory listing of the files on the disk image.
afid uses the same format as an apple ][ running DOS3.3.
free - display a map of free sectors and the number of free and
allocated sectors.
quit, exit - leave afid.
read file - copy the given file from the disk image to a file on the
host computer. Path names are not allowed, so the file
will be placed in the current directory. afid retains
the apple ][ file name so care must be taken that the
name is valid on the host computer file system. For
example, the file named I/O on an apple ][ disk will
cause great problems on a UNIX system.
list file - displays the specified file on the screen. This should
be a text file and you should have set the mode to text
or you will just get a bunch of garbage.
write file - copy the given file from the host computer onto the disk
image. Path names are not allowed, so the file to be
written needs to be in the current directory. afid
retains the apple ][ file name so care must be taken that
the name is valid on the apple ][. Valid apple ][ file
names must start with a letter, be 1 to 30 characters in
length, and may contain any character typable from the
keyboard, except a comma.
binary - sets the translation mode for read/list/write to binary.
Binary mode copies a file without any translation. This
is the default setting.
text - sets the translation mode for read/list/write to text.
In text mode, files are translated as follows: 1) Text
files - CR <-> LF & Apple <-> ASCII 2) All other file
types generate a hex dump of the file.
mode - lists text/binary translation mode for read/write/list
type file,X - changes the file type to X where valid values of X are:
X = T, I, A, B, S, or R. Note that this only changes
the entry in the directory. The actual file is not
touched. This command is used to restore the correct
file type of a file that has been written to a disk
image. This is necessary because all binary writes
create B file types and all text writes create T file
types. type is used to restore the file type to what
it was. You can't use type to magically convert say
an Applesoft basic file into Integer basic. The list
of valid file types is given below:
CODE Meaning Hex Value
---- --------------- ---------
T Text files 0
I Applesoft BASIC 1
A Integer BASIC 2
B Binary programs 4
S Symbol Tables 8
R Relocatable Binary 10
reorder - switch disk sector order between DOS 3.3 (default) and
ProDOS.
rename f1,f2 - rename file f1 to f2 on the disk image",
lock file - write protect a file on the disk image",
unlock file - unwrite protect a file on the disk image",
delete file - delete a file from the disk image.",
undelete fil - undelete a file from the disk image, if possible.",
save image - save the in-memory disk image to a file on the host
computer file system.
Notes:
"save" is important, and changes made with "write" will not be permanent
until you save the disk image. File names are translated to all uppercase
on the Apple disk and to all lowercase on the UNIX end. This is
convenient, but could be annoying. I'm not sure that the text translation
is done correctly. I just empirically judged that twiddling the top bit
was the right thing to do. Binary file copy is a little hokey; pay no mind
to the extra stuff it spits out at you. Disk block ordering can be a
little tricky. Basically, if you make the disk image on a machine running
ProDOS, you'll have to re-order the sectors. This means that probably
anything extracted from a Shrinkit archive will need to be reordered. It
can be hard to tell since the most obvious symptom is a shortened catalog
which is not a lot different from a normally short catalog.
The free command spits out some crap about the sector mask. You can ignore
it, but knowledgeable folks could help me out. I gather that the mask
allows you to specify sectors which cannot be used, but I've never seen a
mask that was usable. What's wrong?
I've compiled afid on a Sun sparcstation with gcc and on an Amiga with
SAS C 5.10. It should be fairly portable as I tryed to write it in ANSI C
and stay away from vendor specific additions. I hope this inspires someone
to create a ProDOS version.
Things to do:
File reads should do something smart like paying attention to the file
type. Also need to add translations for Integer and Applesoft Basic.
Right now we only handle text and binary.
A warning that a preexisting file is going to be overwritten could be put
in. A more robust way of overwriting a file needs to be added. Right
now the sectors aren't cleared first, so if the file you are overwriting
is larger than what you replace it with, the file size will remain the same.
A warning that the disk blocks are out of order could be put in.
Options to switch the file-name mapping on and off would be nice.
A file-duplicating mechanism could be useful if you ever should run into
files with holes. Sector allocation is not done in the same way as DOS 3.3
(not so bad) and may not be very efficient at times (not so good).
Working with two disk images and swapping files back and forth would be
nice.
Adding a 'more' style paging mechanism for list is definitely a necessity.
Preventing the creation of file names with invalid characters is a concern.
The code could use some cleaning up, for sure. I'd try and completely
localize things like the VTOC accesses and come up with a few master
directory scanning and file scanning loops instead of duplicating the code
here and there.
Fix any bugs, but that goes without saying.
Anybody want to create a ProDOS version?
source:
The latest version sh